import absanimateengine from "./absanimateengine";
import lgxcom from '../common/common'
class InflateEngine extends absanimateengine.AbsAnimateEngine {
    constructor(graph) {
        super(graph);
        this.type = "inflate";
        this.maxScale = 3;
        this.minScale = 0.1;
        this.curentScale = 1;
        this.plusFlag = true;//先膨胀，再收缩
    }
    
    animate() {
        console.log("animate InflateEngine -------------------");
        let cntPt = this.destGraph.getPosCopy().getCnt();
        this.destGraph.scale(this.curentScale,this.curentScale,cntPt);
        if (this.plusFlag){
            this.curentScale += this.speed;
            if (this.curentScale > this.maxScale){
                this.plusFlag = false;
            }
        }
        else{
            this.curentScale -= this.speed;
            if (this.curentScale < this.minScale){
                this.plusFlag = true;
            }
        }
    }
}

export default { InflateEngine }